<?php


namespace App\Transformers\User;


use App\Models\User;
use App\Models\UserFriends;
use League\Fractal\TransformerAbstract;

class UserFriendTransformer extends TransformerAbstract
{
    public function transform(User $user)
    {
        return [
            'id' => $user->id,
            'nickname' => $user->nickname ?? '',
            'level' => $user->level ?? '',
            'created_at' => $user->created_at ? $user->created_at->format("Y-m-d H:i:s") : '',
        ];
    }
}
